﻿<%@ Page Title="" Language="C#" MasterPageFile="~/BaseInfoMaster.master" AutoEventWireup="true"
    CodeFile="EditBook.aspx.cs" Inherits="Business_EditBook" %>

<%@ Register Assembly="DevExpress.Web.ASPxGridView.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxRoundPanel" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxPanel" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxPopupControl" TagPrefix="dx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <link type="text/css" rel="stylesheet" href="../Content/Site.css" />
    <style type="text/css">
<!--
td {overflow:hidden;}
-->
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <h1 class="DemoTitle">
        预定信息管理
    </h1>
    <div id="DemoArea">
        <div class="Spacer">
        </div>
        <dx:ASPxRoundPanel ID="Detailpanel" runat="server" Width="500px" HeaderText="客户基本信息"
            Font-Size="10pt" CssFilePath="~/App_Themes/DevEx/{0}/styles.css" CssPostfix="DevEx"
            EnableDefaultAppearance="False" GroupBoxCaptionOffsetX="6px" GroupBoxCaptionOffsetY="-19px"
            SpriteCssFilePath="~/App_Themes/DevEx/{0}/sprite.css">
            <ContentPaddings PaddingBottom="10px" PaddingLeft="7px" PaddingRight="11px" PaddingTop="10px" />
            <HeaderStyle>
                <Paddings PaddingBottom="6px" PaddingLeft="7px" PaddingRight="11px" PaddingTop="1px" />
            </HeaderStyle>
            <PanelCollection>
                <dx:PanelContent ID="PanelContent1" runat="server" SupportsDisabledAttribute="True">
                    <table width="100%" style="font-size: 10pt">
                        <tr>
                            <td style="white-space: nowrap">
                                客户姓名:
                            </td>
                            <td>
                                <dx:ASPxLabel Width="200px" ID="View_CName" Wrap="true" runat="server" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                    CssPostfix="DevEx">
                                </dx:ASPxLabel>
                            </td>
                            <td style="white-space: nowrap">
                                手机号:
                            </td>
                            <td>
                                <dx:ASPxLabel Width="200px" ID="View_PhoneNum" Wrap="true" runat="server" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                    CssPostfix="DevEx">
                                </dx:ASPxLabel>
                            </td>
                        </tr>
                        <tr>
                            <td style="white-space: nowrap">
                                部门:
                            </td>
                            <td>
                                <dx:ASPxLabel Width="200px" ID="View_Department" Wrap="true" runat="server" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                    CssPostfix="DevEx">
                                </dx:ASPxLabel>
                            </td>
                            <td style="white-space: nowrap">
                                性别:
                            </td>
                            <td>
                                <dx:ASPxLabel Width="200px" ID="View_Sex" Wrap="true" runat="server" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                    CssPostfix="DevEx">
                                </dx:ASPxLabel>
                            </td>
                        </tr>
                        <tr>
                            <td style="white-space: nowrap">
                                车牌/车名/颜色:
                            </td>
                            <td>
                                <dx:ASPxLabel Width="200px" ID="View_Car" Wrap="true" runat="server" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                    CssPostfix="DevEx">
                                </dx:ASPxLabel>
                            </td>
                            <td style="white-space: nowrap">
                                重要客户:
                            </td>
                            <td>
                                <dx:ASPxLabel Width="200px" ID="View_IsVip" Wrap="true" runat="server" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                    CssPostfix="DevEx">
                                </dx:ASPxLabel>
                            </td>
                        </tr>
                        <tr>
                            <td style="white-space: nowrap">
                                关联单位:
                            </td>
                            <td>
                                <dx:ASPxLabel Width="200px" ID="View_RefrenceCompany_ID" Wrap="true" runat="server"
                                    CssFilePath="~/App_Themes/DevEx/{0}/styles.css" CssPostfix="DevEx">
                                </dx:ASPxLabel>
                            </td>
                            <td style="white-space: nowrap">
                                职位，头衔:
                            </td>
                            <td>
                                <dx:ASPxLabel Width="200px" ID="View_Position" Wrap="true" runat="server" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                    CssPostfix="DevEx">
                                </dx:ASPxLabel>
                            </td>
                        </tr>
                        <tr>
                            <td style="white-space: nowrap">
                                单位名称:
                            </td>
                            <td colspan="3">
                                <dx:ASPxLabel Width="400px" ID="View_Company" Wrap="true" runat="server" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                    CssPostfix="DevEx">
                                </dx:ASPxLabel>
                            </td>
                        </tr>
                        <tr>
                            <td style="white-space: nowrap">
                                地址:
                            </td>
                            <td colspan="3">
                                <dx:ASPxLabel Width="400px" ID="View_Address" Wrap="true" runat="server" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                    CssPostfix="DevEx">
                                </dx:ASPxLabel>
                            </td>
                        </tr>
                        <tr>
                            <td style="white-space: nowrap">
                                喜好，口味:
                            </td>
                            <td colspan="3">
                                <dx:ASPxLabel Width="400px" ID="View_Favor" Wrap="true" runat="server" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                    CssPostfix="DevEx">
                                </dx:ASPxLabel>
                            </td>
                        </tr>
                        <tr>
                            <td style="white-space: nowrap">
                                备注:
                            </td>
                            <td colspan="3">
                                <dx:ASPxLabel Width="400px" ID="View_Remark" Wrap="true" runat="server" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                    CssPostfix="DevEx">
                                </dx:ASPxLabel>
                            </td>
                        </tr>
                    </table>
                </dx:PanelContent>
            </PanelCollection>
        </dx:ASPxRoundPanel>
        <div class="Spacer" style="height: 14px;">
        </div>
        <dx:ASPxRoundPanel ID="ASPxRoundPanel1" runat="server" Width="450px" HeaderText="预定基础信息"
            Font-Size="10pt" CssFilePath="~/App_Themes/DevEx/{0}/styles.css" CssPostfix="DevEx"
            EnableDefaultAppearance="False" GroupBoxCaptionOffsetX="6px" GroupBoxCaptionOffsetY="-19px"
            SpriteCssFilePath="~/App_Themes/DevEx/{0}/sprite.css">
            <ContentPaddings PaddingBottom="10px" PaddingLeft="7px" PaddingRight="11px" PaddingTop="10px" />
            <HeaderStyle>
                <Paddings PaddingBottom="6px" PaddingLeft="7px" PaddingRight="11px" PaddingTop="1px" />
            </HeaderStyle>
            <PanelCollection>
                <dx:PanelContent ID="PanelContent2" runat="server" SupportsDisabledAttribute="True">
                    <table style="font-size: 10pt">
                        <tr>
                            <td style="white-space: nowrap">
                                录入时间:
                            </td>
                            <td width="200px">
                                <dx:ASPxLabel ID="Edit_AddTime" runat="server" Text="ASPxLabel" Font-Size="10pt"
                                    CssFilePath="~/App_Themes/DevEx/{0}/styles.css" CssPostfix="DevEx">
                                </dx:ASPxLabel>
                            </td>
                            <td style="white-space: nowrap">
                                订金单号:
                            </td>
                            <td width="200px">
                                <dx:ASPxLabel ID="Edit_BookNo" runat="server" Text="ASPxLabel" Font-Size="10pt" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                    CssPostfix="DevEx">
                                </dx:ASPxLabel>
                            </td>
                        </tr>
                        <tr>
                            <td style="white-space: nowrap">
                                营业时段:
                            </td>
                            <td width="200px">
                                <dx:ASPxComboBox runat="server" ID="Edit_Perid_ID" Width="200px" Font-Size="Small"
                                    Enabled="false" CssFilePath="~/App_Themes/DevEx/{0}/styles.css" CssPostfix="DevEx"
                                    SpriteCssFilePath="~/App_Themes/DevEx/{0}/sprite.css" SelectedIndex="0" ValueType="System.Int32">
                                    <ValidationSettings CausesValidation="true">
                                        <RequiredField ErrorText="时段编码不可为空！" IsRequired="true"></RequiredField>
                                    </ValidationSettings>
                                    <LoadingPanelImage Url="~/App_Themes/DevEx/Editors/Loading.gif">
                                    </LoadingPanelImage>
                                    <LoadingPanelStyle ImageSpacing="1px">
                                    </LoadingPanelStyle>
                                </dx:ASPxComboBox>
                            </td>
                            <td style="white-space: nowrap">
                                预定日期:
                            </td>
                            <td>
                                <dx:ASPxDateEdit runat="server" ID="Edit_BookDate" Width="200px" Font-Size="Small"
                                    Enabled="false" CssFilePath="~/App_Themes/DevEx/{0}/styles.css" CssPostfix="DevEx"
                                    SpriteCssFilePath="~/App_Themes/DevEx/{0}/sprite.css">
                                </dx:ASPxDateEdit>
                            </td>
                        </tr>
                        <tr>
                            <td style="white-space: nowrap">
                                订金:
                            </td>
                            <td width="200px">
                                <dx:ASPxTextBox runat="server" ID="Edit_Money" Width="200px" Font-Size="Small" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                    CssPostfix="DevEx" SpriteCssFilePath="~/App_Themes/DevEx/{0}/sprite.css" MaxLength="9">
                                    <MaskSettings Mask="&lt;0..99999g&gt;.&lt;00..99&gt;" />
                                    <ValidationSettings CausesValidation="true">
                                        <RequiredField ErrorText="订金不可为空！" IsRequired="true"></RequiredField>
                                    </ValidationSettings>
                                </dx:ASPxTextBox>
                            </td>
                            <td style="white-space: nowrap">
                                预定类型:
                            </td>
                            <td width="200px">
                                <dx:ASPxComboBox runat="server" ID="Edit_BookType" Width="200px" Font-Size="Small"
                                    CssFilePath="~/App_Themes/DevEx/{0}/styles.css" CssPostfix="DevEx" SpriteCssFilePath="~/App_Themes/DevEx/{0}/sprite.css"
                                    ValueType="System.Int32">
                                    <LoadingPanelImage Url="~/App_Themes/DevEx/Editors/Loading.gif">
                                    </LoadingPanelImage>
                                    <LoadingPanelStyle ImageSpacing="1px">
                                    </LoadingPanelStyle>
                                    <Items>
                                        <dx:ListEditItem Text="预定" Value="0" Selected="true" />
                                        <dx:ListEditItem Text="非确定预定" Value="1" />
                                        <dx:ListEditItem Text="上门客户" Value="2" />
                                    </Items>
                                </dx:ASPxComboBox>
                            </td>
                        </tr>
                        <tr>
                            <td style="white-space: nowrap">
                                联系人姓名:
                            </td>
                            <td width="200px">
                                <dx:ASPxTextBox runat="server" ID="Edit_ContractName" Width="200px" Font-Size="Small"
                                    CssFilePath="~/App_Themes/DevEx/{0}/styles.css" CssPostfix="DevEx" SpriteCssFilePath="~/App_Themes/DevEx/{0}/sprite.css"
                                    MaxLength="50">
                                    <ValidationSettings CausesValidation="true">
                                        <RequiredField ErrorText="联系人姓名不可为空！" IsRequired="true"></RequiredField>
                                    </ValidationSettings>
                                </dx:ASPxTextBox>
                            </td>
                            <td style="white-space: nowrap">
                                联系人电话:
                            </td>
                            <td width="200px">
                                <dx:ASPxTextBox runat="server" ID="Edit_ContractPhoneNum" Width="200px" Font-Size="Small"
                                    CssFilePath="~/App_Themes/DevEx/{0}/styles.css" CssPostfix="DevEx" SpriteCssFilePath="~/App_Themes/DevEx/{0}/sprite.css"
                                    MaxLength="50">
                                    <ValidationSettings CausesValidation="true">
                                        <RequiredField ErrorText="联系人电话不可为空！" IsRequired="true"></RequiredField>
                                    </ValidationSettings>
                                </dx:ASPxTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td style="white-space: nowrap">
                                营销人员姓名:
                            </td>
                            <td width="200px">
                                <dx:ASPxTextBox runat="server" ID="Edit_SalesPerson" Width="200px" Font-Size="Small"
                                    CssFilePath="~/App_Themes/DevEx/{0}/styles.css" CssPostfix="DevEx" SpriteCssFilePath="~/App_Themes/DevEx/{0}/sprite.css"
                                    MaxLength="50">
                                    <ValidationSettings CausesValidation="true">
                                        <RequiredField ErrorText=" 营销人员姓名不可为空！" IsRequired="true"></RequiredField>
                                    </ValidationSettings>
                                </dx:ASPxTextBox>
                            </td>
                            <td style="white-space: nowrap">
                                就餐人数:
                            </td>
                            <td width="200px">
                                <dx:ASPxTextBox runat="server" ID="Edit_PeopleNumber" Width="200px" Font-Size="Small"
                                    CssFilePath="~/App_Themes/DevEx/{0}/styles.css" CssPostfix="DevEx" SpriteCssFilePath="~/App_Themes/DevEx/{0}/sprite.css"
                                    MaxLength="9">
                                    <MaskSettings Mask="&lt;0..9999&gt;" />
                                    <ValidationSettings CausesValidation="true">
                                        <RequiredField ErrorText="就餐人数不可为空！" IsRequired="true"></RequiredField>
                                    </ValidationSettings>
                                </dx:ASPxTextBox>
                            </td>
                        </tr>
                    </table>
                    <table>
                        <tr>
                            <td>
                                <dx:ASPxButton ID="BtnSubmit" Font-Size="10pt" runat="server" Text="提交" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                    CssPostfix="DevEx" SpriteCssFilePath="~/App_Themes/DevEx/{0}/sprite.css" OnClick="BtnSubmit_Click">
                                </dx:ASPxButton>
                            </td>
                            <td>
                                <dx:ASPxButton ID="BtnDel" Font-Size="10pt" runat="server" Text="取消此预定" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                    CssPostfix="DevEx" SpriteCssFilePath="~/App_Themes/DevEx/{0}/sprite.css" ClientSideEvents-Click="function(s,e){if(confirm('确认要取消此预定么？')==1) {}else{e.processOnServer = false;}}"
                                    OnClick="BtnDel_Click">
                                    <ClientSideEvents Click="function(s,e){if(confirm(&#39;确认要取消此预定么？&#39;)==1) {}else{e.processOnServer = false;}}">
                                    </ClientSideEvents>
                                </dx:ASPxButton>
                            </td>
                            <td>
                                <dx:ASPxButton ID="BtnCancel" Font-Size="10pt" runat="server" Text="取消修改、返回" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                    CssPostfix="DevEx" SpriteCssFilePath="~/App_Themes/DevEx/{0}/sprite.css" OnClick="BtnCancel_Click">
                                </dx:ASPxButton>
                            </td>
                            <td>
                                <dx:ASPxButton ID="BtnCheckOut" Font-Size="10pt" runat="server" Text="手动结账" AutoPostBack="false"
                                    CssFilePath="~/App_Themes/DevEx/{0}/styles.css" CssPostfix="DevEx" SpriteCssFilePath="~/App_Themes/DevEx/{0}/sprite.css">
                                    <ClientSideEvents Click="function(s, e) { pcCheck.Show();c_Cancel.SetText('取消'); }" />
                                </dx:ASPxButton>
                            </td>
                        </tr>
                    </table>
                </dx:PanelContent>
            </PanelCollection>
        </dx:ASPxRoundPanel>
        <dx:ASPxGridView ID="gridView" runat="server" Width="100%" AutoGenerateColumns="False"
            CssFilePath="~/App_Themes/DevEx/{0}/styles.css" CssPostfix="DevEx" KeyFieldName="TableID"
            OnRowDeleting="gridView_RowDeleted" OnRowUpdating="gridView_RowUpdated">
            <Styles CssFilePath="~/App_Themes/DevEx/{0}/styles.css" CssPostfix="DevEx">
                <Header ImageSpacing="5px" SortingImageSpacing="5px">
                </Header>
                <LoadingPanel ImageSpacing="5px">
                </LoadingPanel>
            </Styles>
            <ImagesFilterControl>
                <LoadingPanel Url="~/App_Themes/DevEx/GridView/Loading.gif">
                </LoadingPanel>
            </ImagesFilterControl>
            <Images SpriteCssFilePath="~/App_Themes/DevEx/{0}/sprite.css">
                <LoadingPanelOnStatusBar Url="~/App_Themes/DevEx/GridView/StatusBarLoading.gif">
                </LoadingPanelOnStatusBar>
                <LoadingPanel Url="~/App_Themes/DevEx/GridView/Loading.gif">
                </LoadingPanel>
            </Images>
            <Columns>
                <dx:GridViewDataTextColumn Name="t_TableID" FieldName="TableID" VisibleIndex="0"
                    CellStyle-HorizontalAlign="Center" Caption="餐台编码">
                    <EditFormSettings Visible="False" />
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn Name="t_TableName" FieldName="TableName" VisibleIndex="1"
                    CellStyle-HorizontalAlign="Center" Caption="餐台名称">
                    <EditFormSettings Visible="False" />
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn Name="t_PCount" FieldName="PCount" VisibleIndex="2" CellStyle-HorizontalAlign="Center"
                    Caption="人数">
                    <EditFormSettings Visible="False" />
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn Name="t_AreaName" FieldName="AreaName" VisibleIndex="3"
                    CellStyle-HorizontalAlign="Center" Caption="区域">
                    <EditFormSettings Visible="False" />
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataComboBoxColumn Name="t_state" FieldName="State" VisibleIndex="3"
                    CellStyle-HorizontalAlign="Center" Caption="状态">
                    <EditFormSettings Visible="True" CaptionLocation="Near" />
                    <PropertiesComboBox DropDownStyle="DropDownList">
                        <Items>
                            <dx:ListEditItem Text="预定" Value="1" />
                            <dx:ListEditItem Text="非确定预定" Value="2" />
                            <dx:ListEditItem Text="到店" Value="3" />
                            <dx:ListEditItem Text="结账" Value="4" />
                            <dx:ListEditItem Text="离店" Value="9" />
                        </Items>
                    </PropertiesComboBox>
                </dx:GridViewDataComboBoxColumn>
                <dx:GridViewDataTextColumn Name="t_TRemark" FieldName="TRemark" VisibleIndex="4"
                    CellStyle-HorizontalAlign="Center" Caption="备注">
                    <EditFormSettings Visible="False" />
                </dx:GridViewDataTextColumn>
                <dx:GridViewCommandColumn Name="t_Cmd" VisibleIndex="5" CellStyle-HorizontalAlign="Center"
                    Caption="操作">
                    <EditButton Visible="true" Text="变更状态">
                    </EditButton>
                    <DeleteButton Visible="true" Text="撤销预定此桌">
                    </DeleteButton>
                </dx:GridViewCommandColumn>
            </Columns>
            <StylesEditors ButtonEditCellSpacing="0">
                <ProgressBar Height="21px">
                </ProgressBar>
            </StylesEditors>
            <SettingsEditing EditFormColumnCount="1" />
        </dx:ASPxGridView>
        <dx:ASPxPopupControl ID="pcCheck" runat="server" CloseAction="CloseButton" Modal="True"
            PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter" ClientInstanceName="pcCheck"
            HeaderText="手动结账" AllowDragging="True" EnableAnimation="False" EnableViewState="False">
            <ClientSideEvents PopUp="function(s, e) { c_tbMoney.Focus(); }" />
            <ContentCollection>
                <dx:PopupControlContentControl runat="server">
                    <dx:ASPxPanel ID="Panel1" runat="server" DefaultButton="btOK">
                        <PanelCollection>
                            <dx:PanelContent runat="server">
                                <table cellpadding="5" cellspacing="5">
                                    <tr>
                                        <td>
                                            <dx:ASPxLabel ID="lblMoney" Width="60px" runat="server" Text="消费金额:" AssociatedControlID="tbMoney">
                                            </dx:ASPxLabel>
                                        </td>
                                        <td class="pcmCellText">
                                            <dx:ASPxTextBox ID="tbMoney" runat="server" Width="150px" ClientInstanceName="c_tbMoney"
                                                CssFilePath="~/App_Themes/DevEx/{0}/styles.css" CssPostfix="DevEx" SpriteCssFilePath="~/App_Themes/DevEx/{0}/sprite.css">
                                                <MaskSettings Mask="&lt;0..999999g&gt;.&lt;00..99&gt;" />
                                            </dx:ASPxTextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">
                                            <table width="100%" cellpadding="0" cellspacing="0">
                                                <tr>
                                                    <td align="right">
                                                        <dx:ASPxButton ID="btOK" Font-Size="10pt" runat="server" Text="确定" Width="80px" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                                            CssPostfix="DevEx" SpriteCssFilePath="~/App_Themes/DevEx/{0}/sprite.css" OnClick="btOK_Click">
                                                        </dx:ASPxButton>
                                                    </td>
                                                    <td>
                                                        <div style="width: 8px;">
                                                        </div>
                                                    </td>
                                                    <td align="left">
                                                        <dx:ASPxButton ID="btCancel" ClientInstanceName="c_Cancel" Font-Size="10pt" runat="server"
                                                            Text="取消" Width="80px" AutoPostBack="False" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                                            CssPostfix="DevEx" SpriteCssFilePath="~/App_Themes/DevEx/{0}/sprite.css">
                                                            <ClientSideEvents Click="function(s, e) { pcCheck.Hide(); }" Init="function(s, e) { if(s.GetText()=='完成') pcCheck.Hide(); }" />
                                                        </dx:ASPxButton>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </dx:PanelContent>
                        </PanelCollection>
                    </dx:ASPxPanel>
                </dx:PopupControlContentControl>
            </ContentCollection>
        </dx:ASPxPopupControl>
    </div>
</asp:Content>
